home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 1.iso / ARGONET / PD / PROGRAMMING / DESKLIBC / SOURCES.ZIP / DeskLib / !DLSources / Libraries / File / c / printf < prev    next >
Text File  |  1995-07-08  |  1KB  |  36 lines

  1. /*
  2.     ####             #    #     # #
  3.     #   #            #    #       #          The FreeWare C library for 
  4.     #   #  ##   ###  #  # #     # ###             RISC OS machines
  5.     #   # #  # #     # #  #     # #  #   ___________________________________
  6.     #   # ####  ###  ##   #     # #  #                                      
  7.     #   # #        # # #  #     # #  #    Please refer to the accompanying
  8.     ####   ### ####  #  # ##### # ###    documentation for conditions of use
  9.     ________________________________________________________________________
  10.  
  11.     File:    File.printf.c
  12.     Author:  Copyright © 1994 Jason Howat
  13.     Version: 1.00 (28 May 1994)
  14.     Purpose: Do a "printf" to a File.
  15. */
  16.  
  17. #include <stdarg.h>
  18. #include <stdio.h>
  19.  
  20. #include "DeskLib:File.h"
  21.  
  22. extern int File_printf(file_handle file, char *format, ...)
  23. {
  24.   va_list argp;
  25.   char    buff[512];
  26.   int     byteswritten;
  27.  
  28.   va_start(argp,format);
  29.   byteswritten = vsprintf(buff, format, argp);
  30.   if(byteswritten > 0)
  31.     File_WriteBytes(file, buff, byteswritten);
  32.   va_end(argp);
  33.  
  34.   return byteswritten;
  35. }
  36.